﻿
using System.Security.Principal;


namespace Simple.CMS.Web.Authorization
{
    public class AdminPrincipal: IPrincipal
    {
        public AdminPrincipal()
        {
            
        }

        public AdminPrincipal(AdminIdentity identity)
        {
            _adminIdentity = identity;
        }

        private readonly AdminIdentity _adminIdentity;

        public bool IsInRole(string role)
        {
            return _adminIdentity.Roles.Contains(role);
        }
        

        public IIdentity Identity => _adminIdentity;
    }
}
